<% select_options ||= {} %>
<% html_options ||= {} %>
<% html_options[:tab_classes] ||= {} %>
<% html_options[:location] ||= {} %>
<% html_options[:organization] ||= {} %>

<% if show_location_tab? %>
  <div class="tab-pane <%= html_options[:tab_classes][:location] %>" id="locations">
    <%= location_selects f, obj.used_or_selected_location_ids,
            {:disabled => obj.used_location_ids }.merge!(select_options),
            {'data-descendants' => obj.children_of_selected_location_ids.to_json,
             'data-useds' => obj.used_location_ids.to_json }.merge!(html_options[:location]) %>
    <% if obj.kind_of? User %>
      <%= select_f f, :default_location_id, (obj.admin? ? Location.all : obj.my_locations), :id, :title,
                    { :include_blank => true }, { :label => _('Default on login') } %>
    <% end %>
  </div>
<% end %>

<% if show_organization_tab? %>
  <div class="tab-pane <%= html_options[:tab_classes][:organization] %>" id="organizations">
    <%= organization_selects f, obj.used_or_selected_organization_ids,
            {:disabled => obj.used_organization_ids }.merge!(select_options),
            {'data-descendants' => obj.children_of_selected_organization_ids.to_json,
             'data-useds' => obj.used_organization_ids.to_json }.merge!(html_options[:organization]) %>
    <% if obj.kind_of? User %>
      <%= select_f f, :default_organization_id,(obj.admin? ? Organization.all : obj.my_organizations), :id, :title,
                    { :include_blank => true }, { :label => _('Default on login') } %>
    <% end %>
  </div>
<% end %>

